<?php

/**
 * Contains a function to run stripslashes on all $_GET, $_POST, $_COOKIE.
 *
 * PHP Version 5
 *
 * @category BuyLocal
 * @package  BuyLocal
 * @author   Kevin Fodness <kevin.fodness@gmail.com>
 * @author   Mike Pennisi <mpennisi@andrew.cmu.edu>
 * @author   Aaron Ryden <aryden@gmail.com>
 * @license  http://opensource.org/licenses/gpl-license.php GNU Public License
 * @link     http://code.google.com/p/buylocalopensourcerensselaer/
 */

/**
 * A function to run stripslashes recursively on passed input.
 *
 * @param mixed &$src A value to run stripslashes on, if present.
 *
 * @access public
 * @return null
 */
function sanitizeSuperglobals(&$src = null)
{
    if ($src) {
        if (is_array($src)) {
            foreach ($src as &$val) {
                sanitizeSuperglobals($val);
            }
            return;
        } else {
            $src = stripslashes($src);
            return;
        }
    }
}

?>